home *** CD-ROM | disk | FTP | other *** search
/ Aminet 43 / Aminet 43 (2001)(GTI - Schatztruhe)[!][Jun 2001].iso / Aminet / comm / tcp / TaskiSMS.lha / TaskiSMS_Install / Install_TaskiSMS next >
Text File  |  2001-04-24  |  5KB  |  211 lines

  1. ;
  2. ; TaskiSMS install script © by Pawel Filipczak
  3. ;
  4. ; $VER: TaskiSMS_Install 2.55 (18.04.2001) © Pawel Filipczak
  5. ;
  6.  
  7. (set TaskiSMS_version "2.55")
  8.  
  9. (set #about (cat "\n\nWelcome to TaskiSMS v" TaskiSMS_version "\n\nCopyright © 2000-2001 by\n\nPawel Filipczak\n<paplo@taski.com.pl>\n\nhttp://taskisms.taski.com.pl/") )
  10.  
  11. (set #text_where "Where do you wish to install TaskiSMS. A directory called 'TaskiSMS' will be created if one is not there. If a copy of TaskiSMS is found it will be backed up.")
  12. (set #text_exit (cat "\nTaskiSMS Install Complete!\n\n" ))
  13. (set #text_toolbar (cat "Please select default toolbar which you want to use with TaskiSMS\n"))
  14.  
  15. (set #from_dir "InstallData")
  16.  
  17. ; ********************** check for installer version
  18.  
  19. (set inst_version -1)
  20.  
  21. (if (exists "C:Installer" (noreq))
  22.     (set inst_version (/ (getversion "C:Installer") 65536))
  23. )
  24.  
  25. (if (= inst_version -1)
  26.     (if (exists "SYS:Utilities/Installer" (noreq))
  27.         (set inst_version (/ (getversion "SYS:Utilities/Installer") 65536))
  28.     )
  29. )
  30.  
  31. (if (= inst_version -1)
  32.     (if (exists "SYS:Tools/Installer" (noreq))
  33.         (set inst_version (/ (getversion "SYS:Tools/Installer") 65536))
  34.     )
  35. )
  36.  
  37. (if (= inst_version -1)
  38.     (if (exists "SYS:Installer" (noreq))
  39.         (set inst_version (/ (getversion "SYS:Installer") 65536))
  40.     )
  41. )
  42.  
  43. (if (= inst_version -1)
  44.     (if (exists "Installer" (noreq))
  45.         (set inst_version (/ (getversion "Installer") 65536))
  46.     )
  47. )
  48.  
  49. ; ********************** about
  50.  
  51. (message #about)
  52. (welcome) 
  53.  
  54. ;*********************** ask for install dir
  55.  
  56. (set TaskiSMS_dir    (askdir    (prompt #text_where)
  57.                 (help   @askdir-help)
  58.                 (default @default-dest)
  59.             )  
  60. )
  61.  
  62. (set installdir (tackon TaskiSMS_dir "TaskiSMS"))
  63.  
  64.  
  65. ; ************************ check for older installation
  66.  
  67. (set    #old_exists 0)
  68.  
  69. (if (exists installdir) 
  70.   (
  71.  
  72.  
  73.     (set tsms_vernum (getversion (tackon installdir "TaskiSMS")))
  74.     (set tsms_ver (/ tsms_vernum 65536))
  75.     (set tsms_rev (- tsms_vernum (* tsms_ver 65536)))
  76.  
  77.     (if (>= tsms_ver 2)
  78.       (if (>= tsms_rev 50)
  79.         (if (NOT (askbool (prompt "\nInstaller found TaskiSMS v2.5+ installed on your disk.\n\nDo you want to backup older version to TaskiSMS_old directory (click Backup) or update existing version with new files (click Update) ?") (help "") (choices "Update" "Backup")))
  80.             ((rename installdir (tackon TaskiSMS_dir "TaskiSMS_old"))    (set    #old_exists 1))
  81.         )
  82.       ; else
  83.         ((rename installdir (tackon TaskiSMS_dir "TaskiSMS_old"))    (set    #old_exists 1))
  84.       )
  85. ; else
  86.       ((rename installdir (tackon TaskiSMS_dir "TaskiSMS_old"))    (set    #old_exists 1))
  87.     )
  88.  
  89.  
  90.   )
  91. )
  92.  
  93. ; *********************** make TaskiSMS dir
  94.  
  95. (working "Making directories.")
  96.  
  97. (makedir installdir (infos))
  98. (makedir (tackon installdir "Data"))
  99. (makedir (tackon installdir "Data/Prefixes"))
  100. (makedir (tackon installdir "Data/PlugIns"))
  101. (makedir (tackon installdir "Data/Toolbars"))
  102. (makedir (tackon installdir "Docs") (infos))
  103. (makedir (tackon installdir "Docs/images"))
  104.  
  105. ; *********************** copy files
  106.  
  107. ; *** copy main program
  108.  
  109. (working "Copying main program.")
  110.  
  111. (copyfiles    (source (tackon #from_dir "TaskiSMS"))
  112.         (dest    installdir)
  113.         (nogauge)
  114.         (infos)
  115. )
  116.  
  117. ; *** copy prefixes
  118.  
  119. (working "Copying prefixes.")
  120.  
  121. (foreach (tackon #from_dir "Data/Prefixes") "#?"
  122.  
  123.     (copyfiles    (source (tackon (tackon #from_dir "Data/Prefixes") @each-name))
  124.             (dest    (tackon installdir "Data/Prefixes"))
  125.             (nogauge)
  126.  
  127.     )
  128. )
  129.  
  130. ; *** copy plugins
  131.  
  132. (working "Copying plugins.")
  133.  
  134. (foreach (tackon #from_dir "Data/PlugIns") "#?"
  135.  
  136.     (copyfiles    (source (tackon (tackon #from_dir "Data/PlugIns") @each-name))
  137.             (dest    (tackon installdir "Data/PlugIns"))
  138.             (nogauge)
  139.     )
  140. )
  141.  
  142. ; *** copy doc
  143.  
  144. (working "Copying documentation.")
  145.  
  146. (copyfiles    (source (tackon #from_dir "Docs/English.html"))
  147.         (dest    (tackon installdir "Docs"))
  148.         (nogauge)
  149.         (infos)
  150. )
  151.  
  152. (foreach (tackon #from_dir "Docs/images_eng") "#?"
  153.  
  154.     (copyfiles    (source (tackon (tackon #from_dir "Docs/images_eng") @each-name))
  155.             (dest    (tackon installdir "Docs/images_eng"))
  156.             (nogauge)
  157.     )
  158. )
  159.  
  160. ; *** select and copy toolbar
  161.  
  162. (if (>= inst_version 44)
  163.     (showmedia 'tb1' "InstallerData/Toolbars.iff" 'upper_center' 'none' 1)
  164. )
  165.  
  166. (set toolbar    (askchoice (choices "MagicWB style by Andreas Kürzinger" "NewIcon style by Blase" "NewIcon style by Marc Savart" "Glowicon style by OliverTacke" "YAM style by Roman Patzner")
  167.             (prompt #text_toolbar)
  168.             (default 3)
  169.             (help "help")
  170.         )
  171. )
  172.  
  173. (working "Copying toolbar.")
  174.  
  175. (if (= toolbar 0)    (set src_toolbar (tackon #from_dir "Toolbars/AndreasKuerzinger")))
  176. (if (= toolbar 1)    (set src_toolbar (tackon #from_dir "Toolbars/Blase")))
  177. (if (= toolbar 2)    (set src_toolbar (tackon #from_dir "Toolbars/MarcSavart")))
  178. (if (= toolbar 3)    (set src_toolbar (tackon #from_dir "Toolbars/OliverTacke")))
  179. (if (= toolbar 4)    (set src_toolbar (tackon #from_dir "Toolbars/YAM")))
  180.  
  181. (foreach src_toolbar "#?"
  182.     (copyfiles    (source (tackon src_toolbar @each-name))
  183.             (dest    (tackon installdir "Data/Toolbars"))
  184.             (nogauge)
  185.     )
  186. )
  187.  
  188. (if (>= inst_version 44)
  189.     (closemedia tb1)
  190. )
  191.  
  192. (if (= #old_exists 1)
  193.  
  194.     (if (exists (tackon TaskiSMS_dir "TaskiSMS_old/Data/PhoneBook.dat"))
  195.  
  196.         (if (askbool (prompt "\nDo you want to copy PhoneBook from the previous installation of TaskiSMS?") (help "") (choices "Yes" "No"))
  197.  
  198.             (copyfiles    (source (tackon TaskiSMS_dir "TaskiSMS_old/Data/PhoneBook.dat"))
  199.                     (dest    (tackon installdir "Data"))
  200.                     (nogauge)
  201.             )
  202.         )
  203.  
  204.     )
  205. )
  206.  
  207. (set @default-dest installdir)
  208.  
  209. (exit #text_exit)
  210.  
  211.